package com.liu.lambda;

public class Lamdba8 {


    static class MyThread extends Thread {
        @Override
        public void run() {
            System.out.println("I am extends Thread");
        }
    }

    static class MyRunnable implements Runnable {
        @Override
        public void run() {
            System.out.println("I am extends MyRunnable");
        }
    }


    public static void main(String[] args) {
        //lamdba 开启一个线程
        //之前的方法
        MyThread thread = new MyThread();
        thread.start();

        MyRunnable myRunnable = new MyRunnable();
        new Thread(myRunnable).start();


        //lamdba 方法
        Thread lamdbaThread = new Thread(()->{
            System.out.println("I am lamdbaThread");
        });

        lamdbaThread.start();
    }

}
